<%--
  Created by IntelliJ IDEA.
  User: 14258
  Date: 2020/9/9
  Time: 0:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>点赞作业</title>
</head>
    <body>
        <button id="button" type="button">点击点赞</button>
        当前的点赞数：<span id="num">2</span>
    </body>
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('#button').click(function () {
            var likeNum = $("#num").text();
            $.ajax({
                url:"/like",
                data:"likeNum="+likeNum,
                type:"get",
                dataType:"text",
                success:function (result) {
                    $('#num').text(result);
                }
            });
        });
    });
</script>

</html>
